package com.linxianqin.springbootVue.domain.convert;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.linxianqin.springbootVue.domain.dto.SysDictDataDTO;
import com.linxianqin.springbootVue.domain.entity.SysDictData;
import com.linxianqin.springbootVue.domain.vo.SysDictDataExcel;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
import java.util.List;

@Mapper
public interface SysDictDataConvert {
    SysDictDataConvert INSTANCE = Mappers.getMapper(SysDictDataConvert.class);

    SysDictDataDTO entity2dto(SysDictData dictData);
    List<SysDictDataDTO> entity2dto(List<SysDictData> dictData);
    SysDictData dto2entity(SysDictDataDTO dictDataDTO);

    @Mappings({
            @Mapping(target = "ascs",ignore = true),
            @Mapping(target = "asc",ignore = true),
            @Mapping(target = "descs",ignore = true),
            @Mapping(target = "desc",ignore = true),
    })
    Page<SysDictDataDTO> entity2dto(Page<SysDictData> page);

    @Mappings({
            @Mapping(target = "ascs",ignore = true),
            @Mapping(target = "asc",ignore = true),
            @Mapping(target = "descs",ignore = true),
            @Mapping(target = "desc",ignore = true),
    })
    Page<SysDictData> dto2entity(Page<SysDictDataDTO> page);

//    @Mappings({
//            @Mapping(target = "index",ignore = true),
//    })
//    List<SysDictDataExcel> entity2Excel(List<SysDictData> list);
}
